/*
 * testScenarioPanel.h
 *
 *  Created on: Sep 29, 2011
 *      Author: nicoabie
 */

#ifndef TESTSCENARIOPANEL_H_
#define TESTSCENARIOPANEL_H_


#include "../src/common/utils/Logger.h"

#include "../src/SDLtoolkit/widgets/ScenarioPanel.h"

#include <list>


void testScenarioPanel() {

	SDLEngine* engine = new SDLEngine();

	engine->start();


	ScenarioPanel* panel = new ScenarioPanel("./res/img/escenarios/green.bmp",0,0,engine->getMainSurface());

//	Surface* aux = panel->getSurface();
//
//	ScenarioElement* elementoEscenario1 = new ScenarioElement(10,10, &aux,"./res/img/dot.bmp");
//	ScenarioElement* elementoEscenario2 = new ScenarioElement(50,50, &aux,"./res/img/dot.bmp");
//	ScenarioElement* elementoEscenario3 = new ScenarioElement(100,100, &aux,"./res/img/dot.bmp");
//
//	std::list<ScenarioElement*>* elementos = new std::list<ScenarioElement*>();
//	elementos->push_back(elementoEscenario1);
//	elementos->push_back(elementoEscenario2);
//	elementos->push_back(elementoEscenario3);
//
//
//	panel->setElements(elementos);

	Event* event = new Event();

	bool quit = false;
	while (quit == false) {
		while (engine->pullEvent(event)) {

			panel->handleEvent(*event);

			engine->refreshScreen();
			if (event->getType() == Quit) {
				quit = true;
			}
		}
	}
//	delete(elementoEscenario1);
//	delete(elementoEscenario2);
//	delete(elementoEscenario3);
	engine->stop();
}


#endif /* TESTSCENARIOPANEL_H_ */
